<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
echo JhtraqHelper::drawTabs($this->project->slug);
?>
<p></p>
<div class="componentheading">
	<?php echo $this->project->name; ?> - <?php echo JText::_('COM_JHTRAQ_SVN');?> <?php echo JText::_('COM_JHTRAQ_REVISION');?><?php echo $this->version;?>
	
</div>
<?php if($this->view_logs) echo '<small><a href="' . JRoute::_('index.php?option=com_jhtraq&view=svn&project='.$this->project->slug.'&action=svn_logs').'">'.JText::_('COM_JHTRAQ_SVN_LOG').'</a>';?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<thead>
<tr>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_PATH');?></td>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_TYPE');?></td>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_MODIFIED');?></td>
</tr>	
</thead>
<tfoot>
<tr>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_BREADCRUMB');?></td>
<td class="sectiontableheader" colspan="2">
<?php
$path = explode("/",$this->path);
$bread = "";
$parts = array();
$parts[] = '<a href="'.JRoute::_($link.'&path='.$bread).'">...</a>';
foreach($path as $part)
{
 	if($bread == '')
 		$bread .= $part;
 	else
		$bread .= '/'.$part;
	
	$parts[] = '<a href="'.JRoute::_($link.'&path='.$bread).'">'.$part.'</a>';
}
echo implode("/", $parts);
// echo $path;
?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$link = 'index.php?option=com_jhtraq&view=svn&project='.$this->project->slug;
$r = 0;
foreach($this->files as $arr)
{
	?>
	<tr class="sectiontableentry<?php echo $r + 1; ?>">
	<td><?php 
	if($arr['type'] == 'directory')
	{
		if($arr['path'] == $this->path)
		{
			echo '<a href="'.JRoute::_($link.'&path='.DIRNAME($arr['path'])).'">...</a>';
		}else{
			echo '<a href="'.JRoute::_($link .'&path='.$arr['path']).'">'.basename($arr['path']) . '</a>';
		}
	}else{
		echo '<A href="'.JRoute::_($link . '&path='.$arr['path'].'&action=display').'">'.basename($arr['path']).'</a>';
	}?></td>
	<td><?php echo JTEXT::_('COM_JHTRAQ_MODIFIED_SVN_' . strtoupper($arr['type']));?></td>
	<td><?php echo $arr['last-mod']?></td>
	</tr>
	<?php
	$r = 1-$r;
}
?>
</tbody>
</table>